<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{$Think.lang.roleName}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    {include file="public/file_css"}
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
    <form class="layui-form" id="DataForm" lay-filter="DataForm" action="{:url('menu/ajax')}" method="post" onsubmit="return false">
        <div class="layui-form-item">
            <input type="text" name="id" value="" style="display: none;">
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">{$Think.lang.RoleTitle}</label>
            <div class="layui-input-inline">
                <input type="text" name="title" lay-verify="required" lay-reqtext="{$Think.lang.requireEmpty}" value="" class="layui-input">
            </div>
            <label class="layui-form-label required">{$Think.lang.IsEnable}</label>
            <div class="layui-input-inline">
                <input type="radio" name="status" value="1" title="{$Think.lang.Enable}" checked >
                <input type="radio" name="status" value="0" title="{$Think.lang.Disable}" >
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">{$Think.lang.Remark}</label>
            <div class="layui-input-block">
                <textarea name="remark" class="layui-textarea" ></textarea>
            </div>
        </div>
        <div class="layui-form-item" pane="">
            <label class="layui-form-label">{$Think.lang.nodeRole}</label>
            <div class="layui-input-inline">
                <div id="showNode"></div>
            </div>
            <label class="layui-form-label">{$Think.lang.showMenu}</label>
            <div class="layui-input-inline">
                <div id="showMenu"></div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="doSubmit">{$Think.lang.Save}</button>
            </div>
        </div>
    </form>

</div>
{include file="public/file_js"}
<script>
    layui.use(['tree', 'util'], function() {
        var tree = layui.tree
            , layer = layui.layer
            , util = layui.util
        var role = {$role|raw};
        var menu = {$menu|raw};
        //节点权限
        tree.render({
            elem: '#showNode'
            ,data: role
            ,showCheckbox: true  //是否显示复选框
            ,id: 'demoId1'
            ,accordion: true   //手风琴模式展开一个自动收缩上一个
        });
        //菜单权限
        tree.render({
            elem: '#showMenu'
            ,data: menu
            ,showCheckbox: true  //是否显示复选框
            ,id: 'demoId2'
            ,accordion: true   //手风琴模式展开一个自动收缩上一个
        });
    });
</script>
</body>
</html>